import httpInstance from '@/utils/http'

export const getCharacterByBook = (bookId) => {
  return httpInstance({
    url: `/api/aiChat/getCharacterByBook/${bookId}`,
    method: 'get',
  })
}

export const createSession = (characterData) => {
  return httpInstance({
    url: '/api/aiChat/createSession', // 后端创建动态的接口地址
    method: 'post',
    data: characterData, // 动态数据
  })
}

export const getMessages = (sessionId) => {
  return httpInstance({
    url: `/api/aiChat/getMessages/${sessionId}`,
    method: 'get',
  })
}
